package org.zoomdev.zoom.aop.factory;

import org.zoomdev.zoom.aop.Interceptor;

import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.util.List;

public abstract class SingleAnnotationInterceptorFactory<T extends Annotation>
        extends AnnotationInterceptorFactory<T> {
    @Override
    protected void createInterceptor(T annotation, Class<?> targetClass, Method method, List<Interceptor> interceptors) {
        interceptors.add(createInterceptor(annotation, targetClass, method));
    }

    protected abstract Interceptor createInterceptor(T annotation, Class<?> targetClass, Method method);
}
